

/*class Base {
    public void methodA(){
    System.out.println("Base中的methodA()");
    }
}
class Derived extends Base{
    public void methodA(){
    System.out.println("Derived中的methodB()方法");
    }
    public void method() {
        methodA();
        super.methodA();
    }
}
public class Test {
    public static void main(String[] args) {
        Derived derived = new Derived();
        derived.method();
    }
}*/


/*class Base {
    public int a = 100;
    public int b = 200;
}
class Derive extends Base {
    public int a = 1;
    public int b = 2;
    public int c = 101;
    public void method() {
        System.out.println(super.a);
        System.out.println(super.b);
        System.out.println(this.a);
        System.out.println(this.b);
        System.out.println(c);
    }
}*/

class Animals {
    public String name;
    public int age;

    public Animals(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("父类构造代码块被执行了。。。");
    }
    static {
        System.out.println("父类静态代码块被执行了。。。");
    }
    {
        System.out.println("父类实例代码块被执行了。。。");
    }

    public void eat() {
        System.out.println(this.name + "正在吃。。。");
    }
}
class Cat extends Animals {
    public String color;
    public Cat(String name ,int age,String color) {
        super(name,age);
        this.color = color;
        System.out.println("子类构造代码块被执行了。。。");
    }
    static {
        System.out.println("子类静态代码块被执行了。。。");
    }
    {
        System.out.println("子类实例代码块被执行了。。。");
    }
    public void mmm() {
        System.out.println(this.name + "正在喵喵喵");
    }
}
public class Test extends Demo1.Test {
    public void f() {
        System.out.println(super.a);
    }
    public static void main(String[] args) {


    }
}
